package home_8_17;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        System.out.println("1.轿车\t2.客车");
        System.out.println("请选择:");
        int n=in.nextInt();
        Car che=null;
        switch (n){
            case 1:
                System.out.println("轿车的品牌如下:");
                System.out.println("1.宝马");
                System.out.println("2.别克");
                System.out.println("请选择:");
                n=in.nextInt();
                switch (n){
                    case 1:
                        che=new bwm();
                        break;
                    case 2:
                        che=new BieKe();
                        break;
                }
                break;
            case 2:
                System.out.println("请输入乘坐人数");

                n=in.nextInt();
                if (n>15){
                    che = new DaBus(40,1200);
                }else {
                    che = new XiaoBus(15,800);
                }
        }
        System.out.println("日租金:"+che.getPrice());
        System.out.println("你租赁的天数:");
        n=in.nextInt();
        che.setDate(n);
        che.print();

    }
}
